import App from './App'
import uView from "uview-ui"
import { createPinia } from 'pinia'

// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'
Vue.config.productionTip = false
App.mpType = 'app'
const pinia = createPinia() // 创建 Pinia 实例
Vue.use(pinia) 

const app = new Vue({
  ...App,
  pinia
})
app.config.globalProperties.$H = uni.request;
app.$mount()
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'
import store from './store' 
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'  // 导入 element-plus 样式
export function createApp() {
  const app = createSSRApp(App)
  const pinia = createPinia() // 创建 Pinia 实例
  app.use(ElementPlus)  // 注册 element-plus 插件
  app.use(pinia)
  app.use(store) 
  return {
    app
  }
}
// #endif